package com.example.springboot.service.impl;

import com.example.springboot.mapper.BuildingMapper;
import com.example.springboot.pojo.Building;
import com.example.springboot.service.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class BuildingServiceImpl implements BuildingService {

    @Autowired
    private BuildingMapper buildingMapper;

    @Override
    public Building findBuilding(String building) {
        return buildingMapper.findBuilding(building);
    }

    @Override
    public List<Building> getAllBuilding() {
        return buildingMapper.getAllBuilding();
    }

    @Override
    public void addBuilding(String building, Integer unitCount, Integer floorCount, Integer roomCount) {
        buildingMapper.addBuilding(building,unitCount,floorCount,roomCount);
    }

    @Override
    public void deleteBuilding(String building) {
        buildingMapper.deleteBuilding(building);
    }

    @Override
    public void updateBuilding(String building, Integer unitCount, Integer floorCount, Integer roomCount) {
        buildingMapper.updateBuilding(building,unitCount,floorCount,roomCount);
    }
}
